package com.offcn.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 未来后端返回的结果都是 Result 类型
 * @param <T>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {

    private boolean flag; // 是否执行成功
    private Integer code; // 状态码  ==> 通过 StatusCode的常量来赋值
    private T data; // 返回携带的数据
    private String msg; // 本次访问提示信息

    public Result(boolean flag, Integer code, String msg) {
        this.flag = flag;
        this.code = code;
        this.msg = msg;
    }


}
